import { Request, SupplierRequest } from '@/plugins/supplier-request'
import { WORKFLOW_PATH } from './constans'

// 创建（发起）工作流
export function createWorkflow (data) {
  return Request(`${WORKFLOW_PATH}/create`, 'post', data)
}

// 工作流回调
export function responseWorkflow (data) {
  return Request(`${WORKFLOW_PATH}/response`, 'post', data)
}

// 取回工作流
export const retrieveWorkflow = (data, loadingFn) => SupplierRequest({
  url: '/workflow/retrieve',
  type: 'post',
  data,
  loadingFn
});

// 获取工作流跳转地址
export const getWorkflowJumpUrl = (data, loadingFn) => SupplierRequest({
  url: '/workflow/jump-url',
  type: 'post',
  data,
  loadingFn
});
